package com.usaas.search.controller.app;

import com.usaas.common.core.controller.BaseController;
import com.usaas.search.component.AppTokenComponent;
import com.usaas.search.dto.PlatUserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * web层通用数据处理
 *
 * @author ruoyi
 */
@RestController
public class AppBaseController extends BaseController {

    @Autowired
    private AppTokenComponent appTokenComponent;

    public PlatUserDto getUserInfo() {
        return appTokenComponent.getUserInfoWithError();
    }

    public Long getAppUserId() {
        return getUserInfo().getId();
    }

}
